package com.gexiaobao.pigeon.ui.adapter

import com.chad.library.adapter.base.BaseQuickAdapter
import com.gexiaobao.pigeon.R
import com.gexiaobao.pigeon.app.base.DataBindBaseViewHolder
import com.gexiaobao.pigeon.app.model.bean.FollowGoodsListBean
import com.gexiaobao.pigeon.app.util.ImageLoaderManager
import com.gexiaobao.pigeon.databinding.ItemFollowGoodsAuctionBinding
import com.makeramen.roundedimageview.RoundedImageView

/**
 * @Author      : hxw
 * @Date        : 2024/11/30 15:48
 * @Describe    :
 */
class AdapterFollowAuctionGoods(data: ArrayList<FollowGoodsListBean>) :
    BaseQuickAdapter<FollowGoodsListBean, DataBindBaseViewHolder>(R.layout.item_follow_goods_auction, data) {
    override fun convert(holder: DataBindBaseViewHolder, item: FollowGoodsListBean) {
        val binding = DataBindBaseViewHolder.getBinding(holder) as ItemFollowGoodsAuctionBinding
        binding.data = item
        binding.executePendingBindings()//防止列表抖动

        holder.setGone(R.id.ivProxyPriceState, item.proxyId == 0)
        val ivThematicImage = holder.getView<RoundedImageView>(R.id.ivThematicImage)
        ImageLoaderManager.loadRoundImage(context, item.img, ivThematicImage, 6)
    }
}